/*
 * eiam-console - Employee Identity and Access Management
 * Copyright © 2022-Present Jinan Yuanchuang Network Technology Co., Ltd. (support@topiam.cn)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * @name umi 的路由配置
 * @description 只支持 path,component,routes,redirect,wrappers,title 的配置
 * @param path  path 只支持两种占位符配置，第一种是动态参数 :id 的形式，第二种是 * 通配符，通配符只能出现路由字符串的最后。
 * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径，也可以是相对路径，如果是相对路径，会从 src/pages 开始找起。
 * @param routes 配置子路由，通常在需要为多个路径增加 layout 组件时使用。
 * @param redirect 配置路由跳转
 * @param wrappers 配置路由组件的包装组件，通过包装组件可以为当前的路由组件组合进更多的功能。 比如，可以用于路由级别的权限校验
 * @doc https://umijs.org/docs/guides/routes
 */
export default [
  {
    name: 'login',
    path: '/login',
    layout: false,
    hideInMenu: true,
    component: './user/Login',
  },
  // 锁屏
  {
    name: 'lock',
    path: '/lock',
    layout: false,
    hideInMenu: true,
    component: './lock',
  },
  {
    name: 'session-expired',
    path: '/session-expired',
    layout: false,
    hideInMenu: true,
    component: './user/SessionExpired',
  },
  /*欢迎页*/
  // {
  //   name: 'welcome',
  //   path: '/welcome',
  //   component: './Welcome',
  //   icon: 'SmileOutlined',
  //   hideInMenu: true,
  // },

  //账户
  {
    name: 'RoomState',
    icon: 'HomeOutlined',
    path: '/Business',
    component: './account/Business',
    access: 'RoomState',
  },
  // 入住记录
  {
    name: 'CheckInHistory',
    icon: 'StarOutlined',
    path: '/CheckIn_History',
    component: './ChecknHistory/index',
    access: 'CheckIn',
  },
  // 制卡
  {
    name: 'CardIssuance',
    icon: 'LayoutOutlined',
    path: '/Card_Issuance',
    access: 'CardIssuance',
    routes: [
      {
        path: '/Card_Issuance',
        redirect: '/Card_Issuance/ManageCards',
      },

      {
        name: 'ManageCards',
        path: '/Card_Issuance/ManageCards',
        component: './CardIssuance/ManageCards/index',
      },
      {
        name: 'ReportLostCard',
        path: '/Card_Issuance/ReportLostCard',
        component: './CardIssuance/ReportLostCard/index',
      },
      //  {
      //   name: 'HourCard',
      //   path: '/Card_Issuance/HourCard',
      //   component: './CardIssuance/HourCard/index',
      // },
      // {
      //   name: 'Setupcard',
      //   path: '/Card_Issuance/setCardTkon',
      //   component: './CardIssuance/setCardTkon/index',
      // },

    ],
  },

  //  开门记录

  {
    name: 'DoorOpening',
    icon: 'InteractionOutlined',
    path: '/DoorOpening_log',
    access: 'DoorOpening',
    routes: [
      {
        path: '/DoorOpening_log',
        redirect: '/DoorOpening_log/CardProduction',
      },

      {
        name: 'CardProduction',
        path: '/DoorOpening_log/CardProduction',
        component: './DoorOpeningLog/CardProduction/index',
      },
      // {
      //   name: 'OpenDoor',
      //   path: '/DoorOpening_log/OpenDoor',
      //   component: './DoorOpeningLog/OpenDoor/index',
      // },
      {
        name: 'LossReport',
        path: '/DoorOpening_log/LossReport',
        component: './DoorOpeningLog/LossReport/index',
      },
      // {
      //   name: 'RefundHistory',
      //   path: '/DoorOpening_log/Refund_history',
      //   component: './DoorOpeningLog/RefundHistory/index',
      // }
    ],
  },

  // 监控

  // {
  //   name: 'Configuration',
  //   icon: 'VideoCameraOutlined',
  //   path: '/Configuration',
  //   access: 'Configuration',
  //   routes: [
  //     {
  //       path: '/Configuration',
  //       redirect: '/Configuration/DoorLock',
  //     },
  //     {
  //       name: 'DoorLock',
  //       path: '/Configuration/DoorLock',
  //       component: './Configuration/DoorLock/index',
  //     },
  //     {
  //       name: 'Gateway',
  //       path: '/Configuration/Gateway',
  //       component: './Configuration/Gateway/index',
  //     },
  //   ],
  // },
  // 安装
  {
    name: 'FixLock',
    icon: 'PushpinOutlined',
    path: '/FixLock',
    access: 'FixLock',
    routes: [
      {
        path: '/FixLock',
        redirect: '/FixLock/BuildingType',
      },
      {
        name: 'BuildingType',
        path: '/FixLock/BuildingType',
        component: './FixLock/BuildingType/index',
      },

      {
        name: 'RoomSettings',
        path: '/FixLock/RoomSettings',
        component: './FixLock/RoomSettings/index',
      },
      // {
      //   name: 'Gatewayinstall',
      //   path: '/FixLock/Gatewayinstall',
      //   component: './FixLock/Gatewayinstall/index',
      // },
      // {
      //   name: 'DoorLockinstall',
      //   path: '/FixLock/DoorLockinstall',
      //   component: './FixLock/DoorLockinstall/index',
      // },
      {
        name: 'Setupcard',
        path: '/FixLock/setCardTkon',
        component: './FixLock/setCardTkon/index',
      },

      // {
      //   name: 'RegisterCard',
      //   path: '/FixLock/RegisterCard',
      //   component: './FixLock/RegisterCard/index',
      // },
    ],
  },
  // 设置
  {
    name: 'setting',
    icon: 'SettingOutlined',
    path: '/SetUser',
    access: 'setting',
    routes: [
      {
        path: '/SetUser',
        redirect: '/SetUser/Administrator',
      },
      {
        name: 'use',
        path: '/SetUser/Administrator',
        component: './SetUser/Administrator/index',
      },
      {
        name: 'CardPermissions',
        path: '/SetUser/CardPermissions',
        component: './SetUser/CardPermissions.tsx',
      },
    ],

  },
  // {
  //   name: 'HelpDocuments',
  //   icon: 'BellOutlined',
  //   path: '/HelpDocuments',
  //   routes: [
  //     {
  //       path: '/HelpDocuments',
  //       redirect: '/HelpDocuments/help',
  //     },
  //     {
  //       name: 'help',
  //       path: '/HelpDocuments/help',
  //       component: './HelpDocuments/help.tsx',
  //     },
  //   ],
  // },
  {
    path: '/',
    redirect: '/Business',
  },
  {
    path: '*',
    layout: false,
    component: './404',
  },
  {
    path: '/NoInternet',
    layout: false,
    component: './NoInternet',
  },
];
